import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    routes: [{
            path: '/',
            redirect: '/login'
        },
        {
            path: '/login',
            name: 'login',
            component: () =>
                import ('./views/login.vue'),
            meta: {
                state: false
            }
        },
        {
            path: '/home',
            name: 'home',
            component: () =>
                import ('./views/Home.vue'),
            redirect: '/wellcom',
            meta: {
                state: true
            },
            children: [{
                    path: '/wellcom',
                    name: 'wellcom',
                    component: () =>
                        import ('./views/wellcom.vue')
                },
                {
                    path: '/users',
                    name: 'users',
                    component: () =>
                        import ('./views/users.vue')
                },
                {
                    path: '/roles',
                    name: 'roles',
                    component: () =>
                        import ('./views/roles.vue')
                },
                {
                    path: '/rights',
                    name: 'rights',
                    component: () =>
                        import ('./views/rights.vue')
                },
                {
                    path: '/goods',
                    name: 'goods',
                    component: () =>
                        import ('./views/goods.vue')
                },
                {
                    path: '/goodsadd',
                    name: '/goodsadd',
                    component: () =>
                        import ('./views/goodsadd.vue')
                },
                {
                    path: '/goodsedit',
                    name: '/goodsedit',
                    component: () =>
                        import ('./views/goodsedit.vue')
                },
                {
                    path: '/params',
                    name: '/params',
                    component: () =>
                        import ('./views/params.vue')
                },
                {
                    path: '/categories',
                    name: '/categories',
                    component: () =>
                        import ('./views/categories.vue')
                },
                {
                    path: '/orders',
                    name: '/orders',
                    component: () =>
                        import ('./views/orders.vue')
                },
                {
                    path: '/reports',
                    name: '/reports',
                    component: () =>
                        import ('./views/reports.vue')
                }
            ]
        }
    ]
})